package com.mebs.edi.model.edi.e211;

import java.sql.Time;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Embeddable;

import com.mebs.edi.model.dom.DomAttribute;
import com.mebs.edi.model.dom.DomEntity;

/**
 * 
 * BOL section of a 211 EDI file 
 * 
 * @author nit
 *
 */
@Embeddable
@DomEntity(name = "BOL")
public class Edi211Bol {
	
	@Column(nullable = true, length = 4)
	@DomAttribute
	private String bol01; 		// Standard Carrier Alpha Code
	
	@Column(nullable = true, length = 2)
	@DomAttribute
	private String bol02; 		// Shipment Method of Payment
	
	@Column(nullable = true, length = 30)
	@DomAttribute
	private String bol03; 		// Shipment Identification Number
	
	@Column(nullable = true)
	@DomAttribute
	private Date bol04; 		// Date
	
	@Column(nullable = true)
	@DomAttribute
	private Time bol05; 		// Time
	
	@Column(nullable = true, length = 30)
	@DomAttribute
	private String bol06; 		// Reference Identification Number
	
	@Column(nullable = true)
	@DomAttribute
	private Character bol07; 	// Status Report Request Code
	
	public Edi211Bol() {
		super();
	}
	
	public String getBol01() {
		return bol01;
	}

	public void setBol01(String bol01) {
		this.bol01 = bol01;
	}

	public String getBol02() {
		return bol02;
	}

	public void setBol02(String bol02) {
		this.bol02 = bol02;
	}

	public String getBol03() {
		return bol03;
	}

	public void setBol03(String bol03) {
		this.bol03 = bol03;
	}

	public Date getBol04() {
		return bol04;
	}

	public void setBol04(Date bol04) {
		this.bol04 = bol04;
	}

	public Time getBol05() {
		return bol05;
	}

	public void setBol05(Time bol05) {
		this.bol05 = bol05;
	}

	public String getBol06() {
		return bol06;
	}

	public void setBol06(String bol06) {
		this.bol06 = bol06;
	}

	public Character getBol07() {
		return bol07;
	}

	public void setBol07(Character bol07) {
		this.bol07 = bol07;
	}

	@Override
	public String toString() {
		return "Edi211Bol [bol01=" + bol01 + ", bol02=" + bol02 + ", bol03=" + bol03 + ", bol04=" + bol04
				+ ", bol05=" + bol05 + ", bol06=" + bol06 + ", bol07=" + bol07 + "]";
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((bol01 == null) ? 0 : bol01.hashCode());
		result = prime * result + ((bol02 == null) ? 0 : bol02.hashCode());
		result = prime * result + ((bol03 == null) ? 0 : bol03.hashCode());
		result = prime * result + ((bol04 == null) ? 0 : bol04.hashCode());
		result = prime * result + ((bol05 == null) ? 0 : bol05.hashCode());
		result = prime * result + ((bol06 == null) ? 0 : bol06.hashCode());
		result = prime * result + ((bol07 == null) ? 0 : bol07.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Edi211Bol other = (Edi211Bol) obj;
		if (bol01 == null) {
			if (other.bol01 != null)
				return false;
		} else if (!bol01.equals(other.bol01))
			return false;
		if (bol02 == null) {
			if (other.bol02 != null)
				return false;
		} else if (!bol02.equals(other.bol02))
			return false;
		if (bol03 == null) {
			if (other.bol03 != null)
				return false;
		} else if (!bol03.equals(other.bol03))
			return false;
		if (bol04 == null) {
			if (other.bol04 != null)
				return false;
		} else if (!bol04.equals(other.bol04))
			return false;
		if (bol05 == null) {
			if (other.bol05 != null)
				return false;
		} else if (!bol05.equals(other.bol05))
			return false;
		if (bol06 == null) {
			if (other.bol06 != null)
				return false;
		} else if (!bol06.equals(other.bol06))
			return false;
		if (bol07 == null) {
			if (other.bol07 != null)
				return false;
		} else if (!bol07.equals(other.bol07))
			return false;
		return true;
	}

}
